import http from '@/lib/http'

export interface CommentPayload {
  id?: number
  userId?: number
  goodId: number
  content: string
  rating?: number
  images?: string
  status?: number
}

export function fetchComments(params?: any) {
  return http.get('/comment', { params })
}

export function addComment(data: CommentPayload) {
  return http.post('/comment', data)
}

export function updateComment(data: CommentPayload) {
  return http.put('/comment', data)
}

export function deleteComments(idList: (number|string)[]) {
  return http.delete('/comment', { params: { idList } })
}
